package com.inforim.cognos;

import java.net.MalformedURLException;
import java.util.List;

import javax.security.auth.login.LoginException;
import javax.xml.rpc.ServiceException;

import org.apache.axis.client.Stub;

import com.cognos.developer.schemas.bibus._3.BaseClass;
import com.cognos.developer.schemas.bibus._3.BiBusHeader;
import com.cognos.developer.schemas.bibus._3.PropEnum;
import com.cognos.developer.schemas.bibus._3.QueryOptions;
import com.cognos.developer.schemas.bibus._3.Sort;

public interface CognosClient {

	final static int SCOPE_OBJECT = 0;
	final static int SCOPE_ONELEVEL = 1;
	final static String SCOPE_S_OBJECT = "base";

	final static String SCOPE_S_ONELEVEL = "one";
	final static String SCOPE_S_SUBTREE = "sub";
	final static int SCOPE_SUBTREE = 2;

	String formatQueryPath(String desc);
	String getCamid();

	String[][] getData(String path, int scope, Sort[] sorts, long skip,
			long size);

	String[][] getData(String path, long skip, long size);

	String getDispatch();

	String getFullname();

	String getGateway();

	String getNamespace();

	String getPassport();

	String getPassword();

	BiBusHeader getBiBus();

	CognosPlugin getPlugin(String name);

	Stub getService(String name);

	Stub getService(String name, boolean isNewConversation, String RSGroup);

	@SuppressWarnings("rawtypes")
	List getTree(String path, int deep);

	@SuppressWarnings("rawtypes")
	List getTree(String xpath, Sort[] sorts, int deep);

	String getUid();

	String getUsername();

	BaseClass load(String path, Stub stub);

	void logoff();

	void logon() throws LoginException;

	String parseQueryPath(String xpath);

	BaseClass[] query(String path, PropEnum[] props, Sort[] sorts,
			QueryOptions options, Stub stub);

	BaseClass[] search(String path, int scope, PropEnum[] props, Sort[] sorts,
			QueryOptions options, long skip, long size, Stub stub);

	void setDispatch(String dispatch);

	void setGateway(String gateway);

	void setNamespace(String namespace);

	void setPassport(String passport);

	void setPassword(String password);

	void setPlugin(String name, CognosPlugin plugin);

	void setUsername(String username);

	void resetDispatch(String dispatch) throws MalformedURLException,
			ServiceException;

	void reconnect(String passport) throws LoginException;
}
